/*
package com.aaa.come.service.impl;

import com.aaa.come.entity.OutorderDetail;
import com.aaa.come.entity.Pick;
import com.aaa.come.entity.PickDetail;
import com.aaa.come.mapper.PickDetailMapper;
import com.aaa.come.service.PickDetailService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

*/
/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author aaa
 * @since 2020-11-27
 *//*

@Service
public class PickDetailServiceImpl extends ServiceImpl<PickDetailMapper, PickDetail> implements PickDetailService {

    @Autowired
    private PickDetailMapper pickDetailMapper;

    //要用商品编码查出来商品名称，货位编码查出货位名称，根据传入的数量减少库存中该物品的数列，
    //判断传入的商品Id是否以及存在，如果已经存在在基础上增加商品，如果没有新增一个商品明细。
    @Override
    public boolean insert(PickDetail pickDetail) {
        if(findCommoditybar(pickDetail.getCommoditybar())){//判断是否有这个商品编码
            //没有这个商品编码时增加
            pickDetailMapper.insert(pickDetail);
            //增加后还要减少库存内的数量

        }

        return false;
    }


    public boolean findCommoditybar(String commoditybar){
        QueryWrapper<PickDetail> queryWrapper=new QueryWrapper<>();
        queryWrapper.eq("commoditybar",commoditybar);
        Integer integer = pickDetailMapper.selectCount(queryWrapper);
        return integer==0;
    }
}
*/
